public class Duck {
    protected String color;
    protected double heavy;

    // 构造方法
    public Duck(String color, double heavy) {
        this.color = color;
        this.heavy = heavy;
    }

    // 飞行方法
    public void fly() {
        System.out.println("鸭子在飞行");
    }

    // 叫的方法
    public void quack() {
        System.out.println("鸭子在叫");
    }

    // 设置重量的方法
    public void setHeavy(double heavy) {
        this.heavy = heavy;
    }
}